const readline = require('readline');
const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
});

function getInput() {
    return new Promise(function(resolve, reject) {
        getName(resolve, rl);
    });
}

function getName(resolve, rl) {
    rl.question("职位名称：", (ans) => {
        if (ans.trim().length == 0) {
            console.log('格式不正确，请重新输入');
            getName(resolve, rl);
        } else {
            resolve(ans);
            rl.close();
        }
    });
}

module.exports = {
    getInput
}